import request from '@/utils/request'
// ========================= 管理 ======================================
// Get Hedging
export const QueryHedging = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/hedging/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Dispatch Investment
export const DispatchHedging = (data) => {
  return request({
    url: '/v1/prse/hedging/manage/',
    method: 'post',
    data,
  })
}

// Active Record To Special Work
export const ActiveAddSpecialRecord = (rid) => {
  return request({
    url: '/v1/prse/hedging/manage/addSpecialWork/',
    method: 'post',
    params: { rid },
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Hedging
export const CreateMyHedging = (data) => {
  return request({
    url: '/v1/prse/hedging/my/',
    method: 'post',
    data,
  })
}

// Query My Hedging
export const QueryMyHedging = (page, pageSize) => {
  return request({
    url: '/v1/prse/hedging/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Hedging
export const EvaluateMyHedging = (data) => {
  return request({
    url: '/v1/prse/hedging/myEvaluate/',
    method: 'post',
    data,
  })
}

// Preview My Hedging File
export const GetHedgingPreviewImages = (rid) => {
  return request({
    url: '/v1/prse/hedging/my/dataPreView/',
    method: 'get',
    params: { rid },
  })
}

// ============================== 工作者 =========================
// Get Hedging
export const QueryHedgingToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/hedging/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Post Annex File
export const FinishAnnexHedgingToMe = (data) => {
  return request({
    url: '/v1/prse/hedging/worker/',
    method: 'post',
    data,
  })
}
